<template>
  <div>
    <Row justify="space-between" align="middle">
      <Row align="middle">
        <BtnPlain class="com-action-btn" :type="auditStatus | getAuditStatus">{{ auditStatusName }}</BtnPlain>
      </Row>
      <div class="publisher">
        <span>更新时间 {{ updateDateTime || "--" }}</span>
        <Button v-if="isEdit && auditStatus !== 'UnderReview'" class="ml-20" type="primary" @click="onEdit">修改</Button>
        <Button v-if="isEdit && auditStatus === 'UnderReview'" class="ml-20" type="warning" @click="onRevoke">撤销</Button>
      </div>
    </Row>
    <Row class="mt-20" align="middle" v-if="auditStatus === 'NotPass'">
      <h4>拒绝理由</h4>
      <span class="ml-20">{{ companyOffReason }}</span>
    </Row>
  </div>
</template>

<script>
export default {
  name: 'infoHead',
  props: ['auditStatus', 'auditStatusName', 'updateDateTime', 'isEdit', 'companyOffReason'],
  data () {
    return {

    }
  },
  methods: {
    onEdit () {
      this.$emit('edit')
    },
    onRevoke () {
      this.$Modal.confirm({
        title: "温馨提示",
        content: '将撤销本次更改，请确认是否继续？',
        onOk: () => {
          this.$emit('revoke')
        }
      })
    }
  }
}
</script>

<style lang='less' scoped>
.mt-20 {
  margin-top: 20px;
}
.ml-20 {
  margin-left: 20px;
}
</style>
